package com.ibm.cloud.banking.sample.repository;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import javax.persistence.EntityManager;

/**
 * replace desc in here
 *
 * @author HanDong
 * @date 2022/7/28
 */
@Repository
@Transactional(
        readOnly = true
)
public class CustomizedSaveImpl<T> implements ICustomizedSave<T> {

    @Resource
    private EntityManager entityManager;

    @Override
    public <S extends T> S insert(S entity) {
         entityManager.persist(entity);
        return entity;
    }
}
